<script setup lang="ts">
import { Avatar as AAvatar } from 'ant-design-vue';
import type { PersonCardProps } from '../types/PersonCardProps';

const props = defineProps<PersonCardProps>();
const { avatar, name, department, role, img } = props;
</script>

<template>
  <div class="personCard">
    <div class="avatarWrapper">
      <AAvatar :src="avatar" :alt="name" class="avatarImage" />
    </div>
    <div class="cardContent">
      <div class="cardTitle">
        {{ name }}
      </div>
      <div class="cardSubtitle">
        {{ department }}
      </div>
      <div class="roleTag">
        <div class="roleIcon" />
        <img :src="img" alt="Role Icon">
        <div class="roleText">
          {{ role }}
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
.personCard {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 36px;
    gap: 36px !important;
    width: 300px;
    height: 340px;
    background: #f9fafc;
    border-radius: 6px;
  }

  .avatarImage {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
  }

  .cardContent {
    text-align: center;
  }

  .cardTitle {
    font-family: 'PingFang SC', sans-serif;
    font-weight: 500;
    font-size: 28px;
    line-height: 25px;
    margin-bottom: 12px;
    color: #000000;
  }

  .cardSubtitle {
    font-family: 'PingFang SC', sans-serif;
    font-weight: 400;
    font-size: 20px;
    line-height: 20px;
    color: #9092A1;
    margin-bottom: 12px;
  }

  .roleTag {
    margin-left: -15px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px 0px;
    background: #ffffff;
    border-radius: 4px;
  }

  .roleIcon {
    width: 18px;
    height: 16px;
    background: url('/path-to-icon/icon.png') no-repeat center;
    background-size: contain;
  }

  .roleText {
    font-family: 'PingFang SC', sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 20px;
    color: #2468F2;
    margin-left: 6px;
  }
</style>
